package com.probiz.estore.content.service.impl;

import java.util.List;

import com.probiz.estore.common.model.content.ContentRelatedType;
import com.probiz.estore.core.service.impl.GenericManagerImpl;
import com.probiz.estore.content.model.ContentRelatedTypeSearchCriteria;
import com.probiz.estore.content.service.ContentRelatedTypeManager;
import com.probiz.estore.content.dao.ContentRelatedTypeDao;


/**
 * Manager implementation for ContentRelatedType, responsible for business processing, and communicate between web and persistence layer.
 */
public class ContentRelatedTypeManagerImpl extends GenericManagerImpl<ContentRelatedType> implements ContentRelatedTypeManager {

	private ContentRelatedTypeDao contentRelatedTypeDao = null;

	/**
	 * @param contentRelatedTypeDao
	 *            the contentRelatedTypeDao to set
	 */
	public void setContentRelatedTypeDao(ContentRelatedTypeDao contentRelatedTypeDao) {
		this.contentRelatedTypeDao = contentRelatedTypeDao;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.probiz.estore.core.service.impl.GenericManagerImpl#init()
	 */
	@Override
	protected void initManager() {
		dao = contentRelatedTypeDao;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.probiz.estore.core.service.impl.GenericManagerImpl#onDelete(java.lang.Object)
	 */
	@Override
	protected void preDelete(ContentRelatedType entity) {

	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.probiz.estore.core.service.impl.GenericManagerImpl#onSave(java.lang.Object)
	 */
	@Override
	protected void preSave(ContentRelatedType entity) {

	}

	public ContentRelatedType getContentRelatedTypeByName(String typeName) {
		return contentRelatedTypeDao.getContentRelatedTypeByName(typeName);
	}

	public List<ContentRelatedType> getContentRelatedTypeBySearchCriteria(
			ContentRelatedTypeSearchCriteria contentRelatedTypeSearchCriteria) {
		return contentRelatedTypeDao.getContentRelatedTypeBySearchCriteria(contentRelatedTypeSearchCriteria);
	}

}
